Exchange API icon

Exchange API

(3 reviews)

Saved Searches

A saved search is an asset search that can be saved to help users find some assets easier.

The saved searches can be personal or by business group. Personal saved searches can only be used by the user that created them, while business group saved searches can be accessed by all users that have access to the business group.

Saved searches consist of the following properties:

  • name: The name of the query to identify it
  • categories: A list of categories used to filter the assets that have some of these categories. They have the shape as categoryKey:categoryValue, where the categoryKey is the key to the category, and categoryValue is the value of the category. Example: "categories": ["someKey:someValue"]
  • organizationIds: A list of organizations used to filter the assets by belonging to these organizations
  • search: The search term
  • tags: A list of labels used to filter the assets that have some of these labels. They have the shape as ”tag1”,”tag2”. Example: "tags": ["tag1”,”tag2"]
  • types: A list of labels used to filter the assets that have some of these types. They have the

    shape of "rest-api", “http-api”. Example: "types": ["rest-api", “http-api”]

The only parameters that are required are the name. The rest can be omitted.

Note: take into account that the properties categories, tags and organizationIds are used only in the search that uses ANG system.

Note: Only Exchange administrators can save searches for a business group.

Following there are exposed some examples about how to create saved searches

Before executing the examples, read the Anypoint Platform Token section to know how to obtain the token to be used in the examples. This should be replaced for the value ANYPOINT_TOKEN in each curl example.

The examples have been made by cURL, but optionally, instead of sending HTTP commands with cURL, you can use Postman or another application.

Here is an example of how to create a personal saved search. All the fields should be replaced by the ones defined before (after the -d parameter). Remember to replace the :organizationId URL parameter too.

curl -X POST https://anypoint.mulesoft.com/exchange/api/v2/users/me/queries \
     -H 'Authorization: bearer ANYPOINT_TOKEN' \
     -H 'Content-Type: application/json' \
     -d '{ "categories": ["categoryKey:value"], "name": "searchName", "organizationIds": ["67ac7cde-c02c-457f-b826-da2474e63d5a"], "search": "search term", "tags": ["some tag"], "types": ["rest-api"] }'

Here is an example of how to create an organization saved search. All the fields should be replaced by the ones defined before (after the -d parameter). Remember to replace the :organizationId URL parameter too.

curl -X POST https://anypoint.mulesoft.com/exchange/api/v2/organizations/:organizationId/queries \
     -H 'Authorization: bearer ANYPOINT_TOKEN' \
     -H 'Content-Type: application/json' \
     -d '{ "categories": ["categoryKey:value"], "name": "searchName", "organizationIds": ["67ac7cde-c02c-457f-b826-da2474e63d5a"], "search": "search term", "tags": ["tag1","tag2"], "types": ["rest-api"] }'

Reviews

DU
Deleted UserApr 4, 2023, 10:15 PM
Relative URLs to other pages
How can we add relative URLs on the Home page that go to other pages of the API specifications that work on both Exchange and Developer Portal? For example, I'd like to add a link to the Summary page. I tried to use ../../console/summary, but it would fail if I click on this without clicking on Home first. In Dev Portal: first time clicking on asset arrives at: https://anypoint.mulesoft.com/exchange/portals/:organizationId/:groupId/:assetId/ clicking on Home: https://anypoint.mulesoft.com/exchange/portals/:organizationId/:groupId/:assetId/minor/1.0/pages/home/ Summary page: https://anypoint.mulesoft.com/exchange/portals/:organizationId/:groupId/:assetId/minor/1.0/console/summary/ similarly in Exchange https://anypoint.mulesoft.com/exchange/:groupId/:assetId/minor/1.0/ https://anypoint.mulesoft.com/exchange/:groupId/:assetId/minor/1.0/pages/home/ https://anypoint.mulesoft.com/exchange/:groupId/:assetId/minor/1.0/console/summary/
DU
Deleted UserAug 15, 2022, 3:41 PM
Categories API Documentation
https://anypoint.mulesoft.com/exchange/api/v2/organizations/{organizationId}/categories example provided in documentation is not correct, it returns 400 bad request with following. { "status": 400, "message": "Must provide acceptedValues for an enum dataType", "details": {} } the correct example could be { "displayName": "Medical Discipline", "acceptedValues": [ "Salesforce" ], "assetTypeRestrictions": ["custom"] }
DU
Deleted UserOct 25, 2021, 12:32 PM
Useful API Documentation
THanks for documenting this , really useful!